/**
 * Created by Wilson on 1/23/2015.
 */
(function () {
    angular.module('app')
        .controller('servicesController', servicesController);

    servicesController.$inject = ['$scope', 'serviceService', 'alertController', 'tunnelService'];
    function servicesController($scope, serviceService, alertController, tunnelService) {
        $scope.getServiceList = getServiceList;
        $scope.toCallMapPage = toCallMapPage;

        //$scope.getServiceList();

        function toCallMapPage(projId, projType) {
            tunnelService.setData('service.projId', projId);
            tunnelService.setData('service.projType', projType);
        }

        function getServiceList() {
            serviceService.getServiceList().then(function (data) {
                $scope.serviceList = data.datas;
            }).catch(function (data) {
                alertController.simpleAlert(data.errMsg);
            });
        }
    }

})();